Skip to content

feat: Add MSSQL e2e integration test#300

Merged
chlunde merged 1 commit intocrossplane-contrib:masterfrom
baburciu:feat/mssql-e2e-tests
Feb 14, 2026
Merged

feat: Add MSSQL e2e integration test#300
chlunde merged 1 commit intocrossplane-contrib:masterfrom
baburciu:feat/mssql-e2e-tests

Conversation

@baburciu
Copy link
Contributor

@baburciu baburciu commented Dec 5, 2025

Description of your changes

Related to #258 (comment), it adds e2e integration tests for MSSQL.

I have:

  • Read and followed Crossplane's contribution process.
  • Run make reviewable to ensure this PR is ready for review.

How has this code been tested

Tested locally on Ubuntu 24.04.1 LTS. Have commented out the cleanups and could confirm it like this:

$ kubectl get Database,Grant,User
NAME                                          READY   SYNCED   AGE
database.mssql.sql.crossplane.io/example-db   True    True     4m8s

NAME                                          READY   SYNCED   AGE     ROLE           DATABASE     SCHEMA   PERMISSIONS
grant.mssql.sql.crossplane.io/example-grant   True    True     3m55s   example-user   example-db            ["CONNECT","CREATE TABLE","INSERT","SELECT"]

NAME                                        READY   SYNCED   AGE
user.mssql.sql.crossplane.io/example-user   True    True     4m5s
$
$ kubectl exec -it mssql-0 -- /opt/mssql-tools18/bin/sqlcmd -S localhost -U sa -P "$(kubectl get secret mssql-creds -o jsonpath='{.data.password}' | base64 -d)" -C -d example-db -Q "SELECT name FROM sys.database_principals WHERE name = 'example-user'"
name
--------------------------------------------------------------------------------------------------------------------------------
example-user

(1 rows affected)
$ kubectl exec -it mssql-0 -- /opt/mssql-tools18/bin/sqlcmd -S localhost -U example-user -P "$(kubectl get secret example-pw -o jsonpath='{.data.password}' | base64 -d)" -C -d example-db -Q "SELECT DB_NAME() AS DatabaseName"
DatabaseName
--------------------------------------------------------------------------------------------------------------------------------
example-db

(1 rows affected)
$ kubectl exec -it mssql-0 -- /opt/mssql-tools18/bin/sqlcmd -S localhost -U sa -P "$(kubectl get secret mssql-creds -o jsonpath='{.data.password}' | base64 -d)" -C -d example-db -Q "SELECT dp.permission_name, dp.state_desc, pr.name AS principal_name FROM sys.database_permissions dp JOIN sys.database_principals pr ON dp.grantee_principal_id = pr.principal_id WHERE pr.name = 'example-user'"
permission_name                                                                                                                  state_desc                                                   principal_name
-------------------------------------------------------------------------------------------------------------------------------- ------------------------------------------------------------ --------------------------------------------------------------------------------------------------------------------------------
CONNECT                                                                                                                          GRANT                                                        example-user
CREATE TABLE                                                                                                                     GRANT                                                        example-user
INSERT                                                                                                                           GRANT                                                        example-user
SELECT                                                                                                                           GRANT                                                        example-user

(4 rows affected)
$

Signed-off-by: Bogdan-Adrian Burciu <bogdanadrian.burciu@yahoo.com>
@chlunde chlunde enabled auto-merge (squash) February 14, 2026 15:33
@chlunde
Copy link
Collaborator

chlunde commented Feb 14, 2026

Trying close/reopen

@chlunde chlunde closed this Feb 14, 2026
auto-merge was automatically disabled February 14, 2026 15:46

Pull request was closed

@chlunde chlunde reopened this Feb 14, 2026
@chlunde chlunde merged commit 3b7ef31 into crossplane-contrib:master Feb 14, 2026
12 of 14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants